package com.lagou.homework123;

/**
 * 通话套餐类
 * 特征：通话时长、短信条数、每月资费
 * 行为: 显示所有套餐信息
 * <p>
 * 3.3 第三步：实体类的优化 将通话套餐类和上网套餐类中相同的特征和行为提取出来组成抽象套餐类。
 * 3.4.1 让通话套餐类实现通话服务接口。
 */
public class TalkPlan extends Plan implements TackServiceInterface {

    private int talkTime;
    private int messageCount;

    public TalkPlan(int talkTime, int messageCount, int monthExpense) {
        this.talkTime = talkTime;
        this.messageCount = messageCount;
        this.monthExpense = monthExpense;
    }

    //    public void show() {
//        System.out.println("通话套餐明细：");
//        System.out.println("通话时长：" + talkTime + "，短信条数：" + messageCount + "，每月资费：" + monthExpense);
//    }


    @Override
    public void showPlanDetail() {
        System.out.println("通话套餐明细：");
        System.out.println("每月可用通话时长：共" + talkTime + "分钟，每月可用短信条数：" + messageCount + "条，每月套餐资费：" + monthExpense + "元");
    }

    @Override
    public void call(int talkTime, SimCard simCard) {
        System.out.println("本次通话时长：" + talkTime + "分钟");
    }

    public static void test() {
        System.out.println("这是子类TalkPlan的test()静态方法");
    }

    public int getTalkTime() {
        return talkTime;
    }

    public void setTalkTime(int talkTime) {
        this.talkTime = talkTime;
    }

    public int getMessageCount() {
        return messageCount;
    }

    public void setMessageCount(int messageCount) {
        this.messageCount = messageCount;
    }

    public int getMonthExpense() {
        return monthExpense;
    }

    public void setMonthExpense(int monthExpense) {
        this.monthExpense = monthExpense;
    }
}
